package com.zoro.barn.commons.redis.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * config cache duration for a method's result data
 */
@Target({ElementType.TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface CacheDuration {

    /**
     * duration, default is one minute.
     *
     * @return duration
     */
    long value() default 5 * 60 * 1000;
}
